import ajax from './ajax.js'
import store from '../store/index.js'
export function dataList(id, params) {
  return ajax.get({
    url: `api/data/list/day/` + id,
    params
  })
}

export function weekList(id, params = { stockType: 'gg' }) {
  return ajax.get({
    url: `api/data/list/` + id,
    // notoken: !store.state.vuex_token,
    params
  })
}

export function weekListNotoken(params) {
  return ajax.get({
    url: `api/data/list`,
    notoken: !store.state.vuex_token,
    params
  })
}

export function suggest(id) {
  return ajax.get({
    url: `api/data/suggest` + (store.state.vuex_token ? `/123456` : ''),
    notoken: !store.state.vuex_token
  })
}

export function userUpdate(account, params) {
  return ajax.post({
    url: `api/user/update/${account}`,
    // type: 'formData',
    params
  })
}

export function jsapi(params) {
  return ajax.post({
    url: `api/wxv3/jsapi`,
    params
  })
}
